from workflow_nodes.onboarding_workflow import app, State
from traceback import print_exc

if __name__ == "__main__":
    print("启动拉新机器人...")
    print("欢迎来到 X 证券平台，我是您的新手引导员！")
    initial_state = {
        "user_input": "",
        "agent_response": {},
        "current_stage": "注册",
        "continue_conversation": True
    }
    try:
        app.invoke(initial_state, config={"configurable": {"thread_id": "abc123"}})
    except Exception as e:
        print("运行出错：", str(e))
        print_exc()  # 打印完整堆栈
    print("感谢您的使用，祝您投资愉快！")